package com.jiashihui.schema_lgorithm.spring.aspect.asp;

import com.jiashihui.schema_lgorithm.spring.aspect.proxy.IComparatorService;
import com.jiashihui.schema_lgorithm.spring.aspect.proxy.IDivisionService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author jiashihui
 * @describe: AspectTest
 * @date 2019/03/28
 */
public class AspectTest {
    public static void main(String[] args) {
        ApplicationContext ac3 = new ClassPathXmlApplicationContext("spring/spring-aspect.xml");
        IDivisionService bean3 = (IDivisionService) ac3.getBean("calculatorServiceTarget");
        IComparatorService bean4 = (IComparatorService) ac3.getBean("comparatorServiceTarget");
        int division3 = bean3.division(10, 2);
        System.out.println("两数相除商为：" + division3);
        System.err.println("---------------------------------------------------------");
        int add3 = bean3.add(0, 2);
        System.out.println("两数想加和为：" + add3);
        System.err.println("---------------------------------------------------------");
        bean4.comparator(0, 1);
    }
}
